<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <title></title>
      <link rel="stylesheet" href="__STATIC__/css/mui.min.css"/>
    <link rel="stylesheet" href="__STATIC__/css/swiper.min.css">
    <link rel="stylesheet" href="__STATIC__/css/common.css">
    <link rel="stylesheet" href="__STATIC__/css/module.css">
    <script src="__STATIC__/js/jquery.min.js"></script>
    <script src="__STATIC__/js/mui.min.js"></script>
    <script src="__STATIC__/js/swiper.jquery.min.js"></script>
</head>

<body>
<header class="mui-bar mui-bar-nav">
    <a class="mui-action-back mui-icon mui-icon-arrowleft mui-pull-left"></a>
    <h1 class="mui-title">我的收藏</h1>
</header>
<div class="mui-content">
    <div class="shoucang-con">
        <ul class="mui-table-view">
        {volist name="arr" id="vo"}
            <li class="mui-table-view-cell">
                <a href="{:url('index/goods/show',array('id'=>$vo['gid']))}"><img src="/public/{$vo.goods_pic}" alt=""></a>
                <div class="con">
                    <h2><a href="{:url('index/goods/show',array('id'=>$vo['gid']))}">{$vo.goods_name}</a></h2>
                    <div class="price mart10">
                        <p class="mui-pull-left">￥{$vo.price}/斤</p>
                        <a onclick="yichu({$vo.id});"  href="javascript:" data="{$vo.id}" class="mui-pull-right">移出收藏</a>
                        <div class="mui-clearfix"></div>
                    </div>
                </div>
            </li>
            {/volist}
        </ul>
    </div>
</div>

<script type="text/javascript" charset="utf-8">
    //mui初始化
    mui.init({
        swipeBack: true //启用右滑关闭功能
    });
    function yichu(id){
    	var btnArray = ['取消', '确认'];
        mui.confirm('确认要将所选商品移出收藏夹？', '温馨提示', btnArray, function(e) {
            if (e.index == 1) {
            	
            
               url = "{:url('index/User/delcang')}";
            $.post(url, {id:id}, function (data) {
                if (data == 1) {
                	alert("移除成功");
                    //layer.msg("移除成功", {icon: 1, time: 1000});
                    window.location.reload();
                } else {
                    alert("移除失败");
                }
            })
       
            } else {
                console.log("取消了")
            }
        })
    }
    
</script>
</body>
</html>